#ifndef CONFIGDATA_H
#define CONFIGDATA_H

#include <QObject>

class ConfigDataModel : public QObject
{
    Q_OBJECT
    friend QDataStream & operator<< (QDataStream& stream, const ConfigDataModel& model);
    friend QDataStream & operator>> (QDataStream& stream, ConfigDataModel& model);
public:
    explicit ConfigDataModel(QObject *parent = nullptr);

    QString m_filePath;
    bool readFromFile();
    bool readFromFile(QString filePath);
    bool writeToFile();
    bool writeToFile(QString filePath);
    virtual void resetAll();
    virtual ~ConfigDataModel() = 0;

    QString translatedName;
protected:
    bool ensureItemRegisterd();
    virtual void resetSelf() = 0;
};



QDataStream & operator<< (QDataStream& stream, const ConfigDataModel& dataModel);
QDataStream & operator>> (QDataStream& stream, ConfigDataModel& dataModel);

#endif // CONFIGDATA_H
